import { restController, requestMapping } from '../../lib/decorations/restComponent';
import { autowired } from '../../lib/decorations/autowired';
import httpMethod from '../../lib/enum/httpMethod';
import UserService from '../services/UserService';
@restController
export default class UserApi {

    @autowired
    private userService:UserService ;

    
    @requestMapping("/v1/users/:id", httpMethod.POST)
    public async getUser(ctx): Promise<any> {

        const result = await this.userService.getUserById(1234);
        ctx.success(result);
    }

    @requestMapping("/v1/users/:id/score", httpMethod.GET)
    public async getUserScore(ctx): Promise<any> {

        const result = await this.userService.getUserScore(1234);
        ctx.success(result);
    }
}